<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">  
  <title>家具列表</title>
 </head>
 <body>
 
 <?php
   require_once('../system/myFunc.php');
   require_once('../system/dbConn.php');

  connect();
  //编写sql语句
  $sql = 'select a.*,b.* from jiaju a,category b where a.sqh_cid=b.sqh_cid';
  //echo $sql.'<br/>';  
  
  $result = fetch_array($sql);
   
 ?>
 
 <center><h3>家具列表</h3></center>
 <table align="center" width="80%" border=1> 
 <tr>
   <th>家具名称</th>
   <th>家具类别</th>
   <th>家具品牌</th>
   <th>家具添加时间</th>
   <th width="80">家具图片</th>   
   <th>家具简介</th>
    
 </tr>

 <?php
  foreach ($result as $row) {
	 echo '<tr>';
   
	echo "<td><a href='detail.php?id=".$row['sqh_id']."'>".$row['sqh_name']."</a></td>";

  echo '<td>'.$row['sqh_cname'].'</td>';

  echo '<td>'.$row['sqh_brand'].'</td>';

   echo '<td>'.$row['sqh_adddate'].'</td>'; 

	echo '<td><img src="../upload/'.$row['sqh_jiajulink'].'" width="80px"  height="80px"></td>';
	 
	 echo '<td>'.$row['sqh_intro'].'</td>';

   //echo '<td>'.$row['sqh_ischecked'].'</td>'; 
	 
   echo '<td><a href="">修改</a> |
   <a href="del.php?id='.$row['sqh_id'].' " onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';

	 echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($result);
  echo "<table align='center'><tr><td>共有{$totalrows}家具</td></tr></table>";   
 ?>
 
 </body>
</html>